package com.liyunc.op.mem.synch.web.resources;

import com.liyunc.op.mem.synch.dto.response.UserInfoVo;
import com.liyunc.op.mem.synch.dto.rest.GenericResponse;
import com.liyunc.op.mem.synch.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author liyuncong
 * @version 1.0
 * @file UserInfoResource
 * @brief UserInfoResource
 * @details UserInfoResource
 * @date 2023-04-14
 *
 * Edit History
 * ----------------------------------------------------------------------------
 * DATE                        NAME               DESCRIPTION
 * 2023-04-14                  liyuncong          Created
 */
@RestController
@RequestMapping(
    path = "/api/v1/users",
    consumes = MediaType.APPLICATION_JSON_VALUE,
    produces = MediaType.APPLICATION_JSON_VALUE
)
public class UserInfoResource {

    @Autowired
    private UserInfoService userInfoService;

    public GenericResponse<UserInfoVo> queryById(
        @RequestParam("id") Long userId
    ) {
        return GenericResponse.of(userInfoService.queryById(userId));
    }
}
